﻿@{
    Ajax.Dna().Widget()
        .UserPreferences(@<text>
    <div>@item.PropertyDescriptors["FileUrl"].DisplayName</div>
    <div style="margin-top: 5px;">
        @(
 Ajax.Dna().TextBox(item.GenerateFieldID("FileUrl"))
            .Value(item.UserPreferences["FileUrl"] != null ? item.UserPreferences["FileUrl"].ToString() : "http://")
            .GetHtml()
        )
    </div>
    <div>
        @Ajax.Dna().Button(item.GenerateFieldID("btnBrowseIcon")).LocText("RES_BROWSE").Click("$dna.fileDlg(\"" + Url.Action("Dialog", "WebFiles", new { Area = "", website = WebSiteContext.Current.Web.Name }) + "\",$(\"#" + item.GenerateFieldID("FileUrl") + "\"));").ImageIcons(Url.Content("~/content/images/icon_folder_open_16.gif")).GetHtml()
    </div>
    </text>)
        .Content(@<text>
    @if ((ViewData["Content"] != null) && (!string.IsNullOrEmpty(ViewData["Content"] as string)))
    { 
        <div style="margin-top: 5px; padding: 10px;">
            @TextEngine.Wiki(ViewData["Content"].ToString(), topicCssClass: "d-topic")
            @{Html.RegisterStartupScript("var _topic=$('.d-topic'); if (_topic.length) { _topic.dtree(); _topic.before(\"<b>Content table</b>\");}");}
        </div>
    }
    else
    {
        @Html.ValidationSummary()
    }
    </text>)
        .Render();
}
